import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import path from 'path'
import AutoImport from 'unplugin-auto-import/vite'
import VueSetupExtend from 'vite-plugin-vue-setup-extend'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    VueSetupExtend(),
    AutoImport({
      // 后续vue/vue-router/pinia的API都不需要再单独import到setup里面了
      imports: [
            'vue',
            'vue-router',
            'pinia'
        ],
        dts: false
    })
  ],
  resolve: {
    // 路径别名
    alias: {
      // 设置路径
      '~': path.resolve(__dirname, './'),
      "@": path.resolve(__dirname, "./src")
    }
  },
  server: {
    port: 80,
    host: true,
    open: true,
    hmr: true
  }
})